package com.asa.login

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.asa.base.BaseActivity
import com.asa.common.arouter.ARouterConfig
import com.asa.common.ext.setOnSingleClickListener
import com.asa.login.databinding.ActivityLoginBinding
import com.asa.login.viewmodel.LoginViewModel

@Route(path = ARouterConfig.LOGIN_ACTIVITY_HOME)
class LoginActivity : BaseActivity<ActivityLoginBinding,LoginViewModel>() {
    override fun getLayoutId(): Int {
        return R.layout.activity_login
    }


    override fun initData() {
        binding.viewModel = viewModel
        binding.tvLogin.setOnSingleClickListener {
            viewModel.loginAction(binding.etUserName.text.toString(),binding.etPwd.text.toString())
        }
    }

    override fun createViewModel(): LoginViewModel {
        return LoginViewModel()
    }


}